package com.appwoo.txtws.service;

import android.content.Context;
import android.util.Xml;
import com.appwoo.android.exception.NotFoundNetWorkException;
import com.appwoo.android.exception.TimeOutException;
import com.appwoo.android.util.PullIO;
import com.appwoo.txtws.bean.SoftTypeMarketBean;
import com.appwoo.txtws.component.Logger;
import com.appwoo.txtws.component.RqSP;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

public class SoftTypeMarkeServer
{
  private Context context;
  private String number = this.rqsp.getLgDevAccount(paramContext);
  private int pageIndex = 1;
  private int pageSize = 20;
  private RqSP rqsp = new RqSP();

  public SoftTypeMarkeServer(Context paramContext, int paramInt1, int paramInt2)
  {
    this.context = paramContext;
    this.pageIndex = paramInt1;
    this.pageSize = paramInt2;
  }

  public List<SoftTypeMarketBean> getSoftType()
  {
    ArrayList localArrayList1 = new ArrayList();
    String str1 = "无数据";
    String str2 = "<MSG><HEAD><SNDR>" + this.number + "</SNDR> " + "<TYPE>RQSoftType</TYPE></HEAD>" + "<BODY>" + "<PageIndex>" + this.pageIndex + "</PageIndex>" + "<PageSize>" + this.pageSize + "</PageSize></BODY></MSG>";
    MsgService localMsgService = new MsgService();
    try
    {
      Logger.v("io", "msg+=" + str2);
      str1 = localMsgService.sendMessage(this.number, str2, this.context);
      ArrayList localArrayList2 = pullXmlInstall(this.context, str1);
      return localArrayList2;
    }
    catch (IOException localIOException)
    {
      Logger.v("info", str1);
      Logger.v("io", "这里出错了2");
      return localArrayList1;
    }
    catch (XmlPullParserException localXmlPullParserException)
    {
      localXmlPullParserException.printStackTrace();
      return localArrayList1;
    }
    catch (NotFoundNetWorkException localNotFoundNetWorkException)
    {
      localNotFoundNetWorkException.printStackTrace();
      return localArrayList1;
    }
    catch (TimeOutException localTimeOutException)
    {
    }
    return localArrayList1;
  }

  public ArrayList<SoftTypeMarketBean> pullXmlInstall(Context paramContext, String paramString)
    throws IOException, XmlPullParserException
  {
    Object localObject1 = null;
    SoftTypeMarketBean localSoftTypeMarketBean = null;
    Object localObject2 = Xml.newPullParser();
    int i;
    try
    {
      XmlPullParser localXmlPullParser = PullIO.getPullByString(paramString);
      localObject2 = localXmlPullParser;
      i = ((XmlPullParser)localObject2).getEventType();
      if (i == 1)
        return localObject1;
    }
    catch (NullPointerException localNullPointerException)
    {
      while (true)
        localNullPointerException.printStackTrace();
      switch (i)
      {
      case 1:
      default:
      case 0:
      case 2:
      case 3:
      }
    }
    while (true)
    {
      i = ((XmlPullParser)localObject2).next();
      break;
      localObject1 = new ArrayList();
      continue;
      if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("TotalRecord"))
      {
        ((XmlPullParser)localObject2).nextText();
        ((XmlPullParser)localObject2).nextTag();
      }
      if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("list"))
        localSoftTypeMarketBean = new SoftTypeMarketBean();
      if (localSoftTypeMarketBean != null)
        if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("TypeID"))
        {
          localSoftTypeMarketBean.setTypeID(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("TypeName"))
        {
          localSoftTypeMarketBean.setTypeName(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("SoftCount"))
        {
          localSoftTypeMarketBean.setSoftCount(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("TypeIcon"))
        {
          localSoftTypeMarketBean.setTypeIcon(((XmlPullParser)localObject2).nextText());
          continue;
          if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("list"))
          {
            ((ArrayList)localObject1).add(localSoftTypeMarketBean);
            localSoftTypeMarketBean = null;
          }
        }
    }
  }
}

/* Location:           C:\Documents and Settings\Administrator\classes_dex2jar.jar
 * Qualified Name:     com.appwoo.txtws.service.SoftTypeMarkeServer
 * JD-Core Version:    0.6.2
 */